<!--{template "topic_header"}-->
<div class="main {$t_col_main}">

<!--此处三栏-->
<div class="t_col_main_si {$t_col_main_side}">
<div class="t_col_main_fl">
	<div id="topic_index_left_ajax_list">
	<!--{if MEMBER_STYLE_THREE_TOL == 1}-->
	 {template "topic_left.inc"}
	<!--{/if}-->
	</div>
	
</div>
</div>
<!--此处三栏-->

  <div class="main3Box_m HotW ">
    <div class="Hotwarp eventB">
    <div class="e_list_title">{$rs[title]}</div>
	<div class="e_list_box">
	  <div class="left_user_info">
	    <div class="avatar_left">
	      <a target="_blank" href="{$rs[image]}">
	        <img src="{$rs[image]}" height="128" width="100"></img>
	      </a>
	    </div>
	    <div class="avatar2_info event_d" style="margin-right:10px; border-right:1px dashed #ccc;">
	      <p class="left_t2">
	      开始时间：{$rs[fromt]}（{$rs[fromt_day]}）
	      </p>
	      <p class="left_t2">
	      结束时间：{$rs[tot]}（{$rs[tot_day]}）
	      </p>
	      <p class="left_t2">
	        地&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;点：{$rs[address]}
	      </p>
	      <p class="left_t2">
	        发起人：<a href="index.php?mod=$rs[username]"  target="_blank">{$rs[nickname]}</a><a href="index.php?mod=event&code=myevent&uid=$rs[uid]" target="_blank">(查看他的活动)</a>
	      </p>
	      <p class="left_t2">
	      费　　用：{$rs[money]}
	      </p>

	      <p class="left_t21">
	        <a href="javascript:void(0);" onclick="share();return false;" class="efx">分享</a>
	        <!-- {if !$rs[store]} -->
	        <a href="javascript:void(0);" onclick="store('store');return false;" class="esc">收藏</a>
	        <!-- {else} -->
	        <a href="javascript:void(0);" onclick="store('cancle');return false;" class="esc">取消收藏</a>
	        <!-- {/if} -->
	        <!-- {if MEMBER_ID == $rs[postman]} -->
	        <a href="javascript:void(0);" onclick="manage(1);return false;" class="egl">管理</a>
	        <a href="javascript:void(0);" onclick="window.location.href='index.php?mod=event&code=export_to_excel&id=$id';return false;" class="edc">导出</a>
	        <!-- {/if} -->
	      </p>
	      <!-- {if MEMBER_ID == $rs[postman]} -->
	      <p class="left_t21">
	       <a href="index.php?mod=event&code=editevent&id=$rs[id]" class="exg">修改活动</a>
	       <a href="index.php?mod=event&code=del&id=$rs[id]" onclick="return confirm('你确实要删除吗?不可恢复');" class="edel">删除活动</a>
	      </p>
	      <!-- {/if} -->
	    </div>
	    <div class="e_detail_sign">
		  <p class="ri_t2">{$rs[app_num]}人报名</p>
		  <p class="ri_t2">同意{$rs[play_num]}人 参与</p>
	      <p id="event_type"><span>{$rs[event_type]}</span></p>
	      <p id="app">
	      <!-- {if $rs[app] == 1} -->
	      <a id="activity_cancel" href="javascript:void(0);" onclick="app('cancle');return false;">取消报名</a>
	      <!-- {else} -->
	      <a id="activity_signin" href="javascript:void(0);" onclick="app('app');return false;">我要报名</a>
	      <!-- {/if} -->

	      </p>
	    </div>
	  </div>
	</div>
	
	<div class="e_idS">
	  <div class="e_idSpTitle">
	    <b>活动简介</b>
	  </div>
	  <div class="e_intro">
	    {$rs[content]}
	  </div>
	  
	<!--{if MEMBER_ID>0}-->
	<!--评论发布框 Begin-->
	<div class="mWarp">
		<form action="" method="POST" name="topic_simple_form" id="topic_simple_form" onsubmit="return false;" autocomplete="off">
			<table>
				<tr>
				  <td colspan="2">
					  <div class="fbqCount"><style type="text/css">ul.mycon li{ width:65px;}</style>
					<ul class="mycon fontGreen" style="width:130px">
					  <li>还可以输入</li>
					  <li style="width:auto"><span style='color:#339900;' id="app_wordc">{conf topic_length}</span></li>
					  <li style="width:40px;">个字符</li>
					</ul>
					</div>
				
					<!-- 转发插入表情-->
					<script type="text/javascript">
						 $(document).ready(function(){
						 $(".menu_bqb_c").click(function(){$("#app_bq_view").show();})
						 });
					</script>
					<textarea  id="app_content" name="content" onkeyup="javascript:checkPublishText({conf topic_length},'app_content','app_wordc')" class="Pbox_te" style="width:538px; height:60px;"></textarea>
			  </td>
			</tr>
			<tr>
			<td>
			<div class="menuf">
			  <div class="menuf_bq" ><b class="menu_bqb_c"><a href="javascript:void(0);" onclick="topic_face('app_bq_view','app_content');return false;">表情</a></b>
			    <div class="forward_f" id="app_bq_view"></div>
			  </div>
			</div>
			</td>
				<td align="right">
					<input id="app_topic_type" type="checkbox" onclick="selectAppTopicType(this.id)"  value="first" checked="checked">分享到微博 
					&nbsp;&nbsp;
					<input id="app_publish_btn" onclick="reply({$id});listTopic();return false;" type="button" value="发 布" class="shareI"/>
					<input type="hidden" id="hid_id" name="hid_id" value="{$id}"></input>
					</td>
				</tr>
			</table>
		</form>
		<div id="listTopicArea">
		{template "topic_list_ajax"}
		</div>
		<div id="share"></div>
		<div id="need_info"></div>
	</div>
	<script type="text/javascript">
	<!--{if isset($_GET['signin']) && $_GET['signin'] == "true" }-->
		$(function(){ $("#activity_signin").click(); });
	<!--{elseif isset($_GET['signin']) && $_GET['signin']=="cancel" }-->
		$(function(){ $("#activity_cancel").click(); });
	<!--{/if}-->
	
	function reply(id){
		var content = $('#app_content').val();
		var options = {
			response:function(){
				listTopic();
			},
			topic_type:$('#app_topic_type').val()
		}
		publishSimpleTopic(content, 'event', id, options)
	
		$('#app_content').val('');
	}

	function listTopic() {
		var id = document.getElementById('hid_id').value;
		var myAjax = $.post(
			"ajax.php?mod=app&code=list_event&item_id="+id,
			function (d) {
				$("#listTopicArea").html(d);
			}
		); 
	}
	
	function share(t){
		var handle_key = "share";
		$.post(
				"ajax.php?mod=event&code=publish_share&id=$id",
				function(d){
					showDialog(handle_key, 'local', '分享到微博', {"html":d}, 500);
					$('#topic_simple_close_btn').click(
						function() {
							if(t){
								location.reload();
							}else{
								closeDialog(handle_key);
							}
						}
					);
					$('#topic_simple_share_btn').click(
						function () {
							var options = {
									response:function(){
										closeDialog(handle_key);
									}
								}
							publishSimpleTopic($('#topic_simple_content').val(), 'web', $("#topic_simple_item_id").val(),options);
							MessageBox('notice', '分享成功');
						}
					);
				}
		);
	}

	function simpleTalk(){
		var handle_key = "simpletalk";
		$.post(
				"ajax.php?mod=event&code=simple_talk&id=$id",
				function(d){
					showDialog(handle_key, 'local', '报名成功，说说你对该活动有什么看法？', {"html":d}, 500);
					$('#topic_simple_close_btn').click(
						function() {
							location.reload();
						}
					);
					$('#topic_simple_share_btn').click(
						function () {
							var options = {
									response:function(){
										location.reload();
									},
									topic_type:$('#topic_simple_type').val()
								}
							if(!$('#topic_simple_content').val()){MessageBox('notice', '请输入评论内容');return false;}
							publishSimpleTopic($('#topic_simple_content').val(), 'event', $("#topic_simple_item_id").val(),options);
						}
					);
				}
		);
	}

	function store(t){
		$.post("ajax.php?mod=event&code=store&id=$id&type="+t,
				function(d){
			location.reload();
			}
		);
	}

	function app(t){
	
		var myAjax=$.post(
				"ajax.php?mod=event&code=app&id=$id&type="+t,
				function(d){
					if(!is_json(d)){
						var handle_key = 'need_info';
						showDialog(handle_key, 'ajax', '我要参加', {url:"ajax.php?mod=event&code=app&id=$id&type="+t}, 300);
					}else{
						var json = eval('('+d.toString()+')');
						if(json.done){
							if(json.msg == '1'){
								simpleTalk();
							}else{
								MessageBox('notice', json.msg);
								setTimeout('location.reload()',1000);
							}
						}else{
							MessageBox('warning', json.msg);
						}
					}
				}
		);
	}

	function manage(page){
		handle_key = "manage";
		showDialog(handle_key, 'ajax', '我要参加', {url:"ajax.php?mod=event&code=manage&id=$id&page="+page}, 600);
	}
	</script>
<script>
$("#app_content").bind('keydown',function(event){
	event = event || window.event;
    if (event.keyCode == 13 && event.ctrlKey) {
        $("#app_publish_btn").click();
    }
});
</script>
	<!--评论发布框 End-->
	<!--{/if}-->
		
	</div>
  </div>
  <div class="Hotright">
  <div class="HboxR">
    <ul class="vote_r_nav">
      <li>
        <a href="index.php?mod=event"><span>活动主页</span></a>
      </li>
      <li>
        <a href="index.php?mod=event&code=myevent"><span>我的活动</span></a>
      </li>
	  <li>
		<a href="index.php?mod=event&code=followevent"><span>我关注的人的活动</span></a>
	  </li>
      <li>
        <a href="index.php?mod=event&code=pevent"><span>发起活动</span></a>
      </li>
    </ul>
  </div>
  <div  class="HboxR">
    <div class="vote_line">这个活动的参与者</div>
    <div>
      <ul class="followList eli" style="overflow:hidden">
        <!-- {loop $play_member $val} -->
        <li class="pane" id="follow_user_{$val[uid]}">
          <div class="fBox_l"><img onerror="javascript:faceError(this);" src="{$val[face]}" onmouseover="get_user_choose({$val[uid]},'_user',{$val[uid]});" onmouseout="clear_user_choose();"/> </div>
          <div id="user_{$val[uid]}_user" class="layS"></div>
        </li>
      <!-- {/loop} -->
      </ul>
    </div>
  	<div><a href="index.php?mod=event&code=alluser&id=$id&type=play">共{$play_count}人(查看所有参与者)</a></div>
  </div>  
  
  <div class="HboxR">
    <div class="vote_line">审核中的报名者</div>

      <ul class="followList eli">
        <!-- {loop $app_member $val} -->
        <li class="pane" id="follow_user_{$val[uid]}">
          <div class="fBox_l"><img onerror="javascript:faceError(this);" src="{$val[face]}" onmouseover="get_user_choose({$val[uid]},'_user',{$val[uid]});" onmouseout="clear_user_choose();"/> </div>
          <div id="user_{$val[uid]}_user" class="layS"></div>
        </li>
      <!-- {/loop} -->
	  <li style="width:180px;"><a href="index.php?mod=event&code=alluser&id=$id&type=app">共{$app_count}人(查看所有审核中报名者)</a> </li>
      </ul>

    
  </div>
</div>
</div>
</div>
<!--{template "topic_footer"}-->